Skip to content

fix(security): address path traversal, buffer overflow and logic vulnerabilities#13

Closed
RinZ27 wants to merge 2 commits intoembeddedos-org:masterfrom
RinZ27:fix/security-and-logic-improvements
Closed

fix(security): address path traversal, buffer overflow and logic vulnerabilities#13
RinZ27 wants to merge 2 commits intoembeddedos-org:masterfrom
RinZ27:fix/security-and-logic-improvements

Conversation

@RinZ27
Copy link
Copy Markdown
Member

@RinZ27 RinZ27 commented Apr 14, 2026

Summary

Addressing several security vulnerabilities and technical debt identified during a recent audit. The focus is on improving the robustness of path handling, ensuring memory safety in the C SDK, and resolving various logic/syntax errors across the Go codebase.

Type of Change

  • fix — Bug fix
  • refactor — Code restructuring without behavior change
  • test — Add or fix tests

Changes

  • Sanitized environment variable paths using filepath.Clean in config and tcp packages to prevent potential path traversal.
  • Hardened file permissions for audit logs, switching from 0644 to 0600 to restrict access to the file owner.
  • Implemented bounds checking in protocol/frame.go to prevent integer overflow during frame encoding and decoding.
  • Fixed critical memory safety issues in the C SDK by ensuring proper null-termination after all strncpy calls.
  • Removed unsafe deserialization into interface{} in the CLI tool, opting for direct pretty-printing of JSON payloads.
  • Resolved multiple syntax errors, duplicate code blocks, and unhandled errors in core, security, and transport packages.
  • Added missing #include <stdlib.h> in eipc_client.c to fix build failures related to rand().

Testing

  • Unit tests pass (verified with go test ./...)
  • Code compiles without warnings (verified Go build and CMake for C SDK)
  • Manual testing performed (checked CLI tool behavior with Indent fix)

Pre-Submission Checklist

  • Code compiles without warnings
  • All existing tests pass
  • Commit messages follow (): convention
  • Branch is rebased on latest master

Related Issues

N/A

Additional Notes

These changes significantly improve the security posture of the IPC framework without altering the core business logic. Stability was a major priority, especially in fixing the broken source files encountered in the core and auth modules.

@RinZ27 RinZ27 requested a review from a user April 14, 2026 04:12
@RinZ27 RinZ27 force-pushed the fix/security-and-logic-improvements branch 2 times, most recently from 6ce30d1 to 402b409 Compare April 14, 2026 05:21
@RinZ27 RinZ27 force-pushed the fix/security-and-logic-improvements branch from 402b409 to 5b56a93 Compare April 14, 2026 05:34
srpatcha pushed a commit that referenced this pull request Apr 14, 2026
Includes all changes from PR #13 (by RinZ27) plus:
- Added error checking (errcheck) across 16 files
- Removed unused field broker.running
- Removed unused func computeChallengeResponse
@srpatcha
Copy link
Copy Markdown
Member

Superseded by PR #14 which includes all your security fixes plus errcheck lint fixes. Thank you @RinZ27!

@srpatcha srpatcha closed this Apr 14, 2026
@RinZ27 RinZ27 deleted the fix/security-and-logic-improvements branch April 16, 2026 12:59
@RinZ27
Copy link
Copy Markdown
Member Author

RinZ27 commented Apr 16, 2026

@srpatcha Appreciate the update! Glad to see the security fixes are being integrated into the broader cleanup in #14. I'll be following the progress there.

srpatcha added a commit that referenced this pull request Apr 17, 2026
…#14)

* fix(security): address path traversal, buffer overflow and logic vulnerabilities

* chore(ci): fix linting and cross-platform path issues in tests

* fix(security): address vulnerabilities + fix all errcheck lint errors

Includes all changes from PR #13 (by RinZ27) plus:
- Added error checking (errcheck) across 16 files
- Removed unused field broker.running
- Removed unused func computeChallengeResponse

---------

Co-authored-by: RinZ27 <222222878+RinZ27@users.noreply.github.com>
Co-authored-by: Srikanth Patchava <Srikanth.Patchava@brooksautomation.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants